<?php
include_once("../common.php");

if(! isVisitor() && isset($_GET['id']) && isset($_GET['name'])){
	$c = connect();
	$r = mysql_query("SELECT idusers, username, first_name, last_name FROM users WHERE username = '".$_GET['name']."'");
	$usr = mysql_fetch_assoc($r);
	if(!$usr)
		return false;
	mysql_query("INSERT INTO authors (users_idusers, articles_idarticles) VALUES ('".$usr['idusers']."','".$_GET['id']."')");
	mysql_close($c);
	return implode(",", $usr);
}
?>
